package work20241206_chap7.n_demo11;

/**
 * @author zdl
 * @date 2024/12/5
 */
public abstract class Shape {
    private int a;//边长1
    private int b;//边长2

    public Shape() {
    }

    public Shape(int a, int b) {
        this.a = a;
        this.b = b;
    }
    //面积
    public abstract double area();
    //周长
    public abstract double girth();

    /**
     * 获取
     * @return a
     */
    public int getA() {
        return a;
    }

    /**
     * 设置
     * @param a
     */
    public void setA(int a) {
        this.a = a;
    }

    /**
     * 获取
     * @return b
     */
    public int getB() {
        return b;
    }

    /**
     * 设置
     * @param b
     */
    public void setB(int b) {
        this.b = b;
    }

    public String toString() {
        return "Shape{a = " + a + ", b = " + b + "}";
    }
}
